package com.boarsoft.web.websocket;

import javax.websocket.Session;

/**
 * 
 * @author Mac_J
 *
 */
public interface WebsocketListener {
	/**
	 * 
	 * @return
	 */
	String getCode();

	/**
	 * 
	 * @param session
	 */
	void onOpen(Session session);

	/**
	 * 
	 * @param session
	 */
	void onClose(Session session);

	/**
	 * 
	 * @param m
	 * @param session
	 */
	void onMessage(WebsocketMessage m, Session session);

	/**
	 * 
	 * @param session
	 * @param error
	 */
	void onError(Session session, Throwable error);
}
